file_prefix_or_same (GFile *file1,
GFile *file2)
{
- const gchar *file1path;
- const gchar *file2path;
-
- if (g_file_has_prefix (file1, file2))
- return TRUE;
-
- file1path = g_file_get_path (file1);
- file2path = g_file_get_path (file2);
-
- return g_strcmp0 (file1path, file2path) == 0;
+ return g_file_has_prefix (file1, file2) ||
+ g_file_equal (file1, file2);
}
static gboolean
GVolume *volume,
GDrive *drive)
{
- gboolean *current_location_on_volume;
- GMount *mount_default_location;
+ gboolean current_location_on_volume;
+ GFile *mount_default_location;
GMount *mount_for_volume;
GList *volumes_for_drive;
GList *volume_for_drive;
break;
}
}
- g_object_unref (volumes_for_drive);
+ g_list_free_full (volumes_for_drive, g_object_unref);
}
}
sidebar->gtk_settings = NULL;
}
+ if (sidebar->current_location != NULL)
+ {
+ g_object_unref (sidebar->current_location);
+ sidebar->current_location = NULL;
+ }
+
G_OBJECT_CLASS (gtk_places_sidebar_parent_class)->dispose (object);
}
if (sidebar->current_location != NULL)
g_object_unref (sidebar->current_location);
- sidebar->current_location = g_file_dup (location);
+ sidebar->current_location = g_object_ref (location);
if (location == NULL)
goto out;